<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "cti_cdr".
 *
 * @property int $id 话单的id
 * @property string $direction 呼入还是呼出inbound为呼出，outbound呼入
 * @property string $user_name 坐席名字
 * @property string $sip_from_user 播出电话
 * @property string $telephone_assignment 电话号码归属地
 * @property string $sip_to_user 外地电话
 * @property string $user_context 所属
 * @property int $start_epoch 响铃时间
 * @property int $answer_epoch 接通时间
 * @property int $end_epoch 结束时间
 * @property int $duration 响铃时长
 * @property int $billsec 通话时长（计费时长）
 * @property string $continue_on_fail 结束原因
 * @property string $uuid 唯一的uuid
 * @property string $call_uuid a-leg的uuid
 * @property string $bridge_uuid b-leg的uuid
 * @property string $remark 备注
 * @property string $create_at 创建时间
 */
class CtiCdr extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'cti_cdr';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['start_epoch', 'answer_epoch', 'end_epoch', 'duration', 'billsec'], 'integer'],
            [['direction'], 'string', 'max' => 10],
            [['user_name', 'sip_from_user', 'sip_to_user', 'user_context', 'continue_on_fail'], 'string', 'max' => 30],
            [['telephone_assignment'], 'string', 'max' => 60],
            [['uuid', 'call_uuid', 'bridge_uuid'], 'string', 'max' => 40],
            [['remark'], 'string', 'max' => 255],
            [['create_at'], 'string', 'max' => 13],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => '话单的id',
            'direction' => '呼入还是呼出inbound为呼出，outbound呼入',
            'user_name' => '坐席名字',
            'sip_from_user' => '播出电话',
            'telephone_assignment' => '电话号码归属地',
            'sip_to_user' => '外地电话',
            'user_context' => '所属',
            'start_epoch' => '响铃时间',
            'answer_epoch' => '接通时间',
            'end_epoch' => '结束时间',
            'duration' => '响铃时长',
            'billsec' => '通话时长（计费时长）',
            'continue_on_fail' => '结束原因',
            'uuid' => '唯一的uuid',
            'call_uuid' => 'a-leg的uuid',
            'bridge_uuid' => 'b-leg的uuid',
            'remark' => '备注',
            'create_at' => '创建时间',
        ];
    }
}
